<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row">
            <form class="layui-form layui-form-pane" id="signupForm">
                <input id="deviceId" name="deviceId" th:if="${addType == 0}" th:value="${node.deviceId}" type="hidden" />
                <input id="shopId" name="shopId" th:value="${node.shopId}" type="hidden" />
                <input id="id" name="id" th:value="${node.id}" type="hidden" />

                <div class="layui-form-item">
                    <label class="layui-form-label">设备名称</label>
                    <div class="layui-input-block">
                        <input id="terminalName" name="terminalName" th:value="${node.terminalName}" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item" th:if="${addType == 1}">
                    <label class="layui-form-label">所属设备</label>
                    <div class="layui-input-block">
                        <select id="deviceId" name="deviceId" class="layui-input" lay-search="" lay-filter="deviceId">
                            <option value="">所属设备</option>
                            <th:block th:each="d : ${devices}">
                                <option th:value="${d.id}" th:selected="${node.deviceId == d.id}" th:text="${d.deviceNum + '-' + d.deviceName}"></option>
                            </th:block>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备类型</label>
                    <div class="layui-input-block">
                        <select name="deviceType" id="deviceType" lay-filter="deviceType">
                            <option value="">请选择设备类型</option>
                            <option value="2" th:selected="${node.deviceType == 2}">测高温设备</option>
                            <option value="3" th:selected="${node.deviceType == 3}">测电流设备</option>
                            <option value="4" th:selected="${node.deviceType == 4}">测重量设备</option>
                            <option value="6" th:selected="${node.deviceType == 6}">测电压设备</option>
                            <option value="5" th:selected="${node.deviceType == 5}">雷达测距设备</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">位置类型</label>
                    <div class="layui-input-block">
                        <select name="positionType" id="positionType" lay-filter="positionType">
                            <option value="">请选择位置类型</option>
                            <!--                            <option value="0">未保养</option>-->
                            <option value="1" th:selected="${node.positionType == 1}">制粒机检测</option>
                            <option value="2" th:selected="${node.positionType == 2}">锅炉测温</option>
                            <option value="3" th:selected="${node.positionType == 3}">油罐检测</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">节点编号</label>
                    <div class="layui-input-block">
                        <input id="nodeIndex" name="nodeIndex" th:value="${node.nodeIndex}" class="layui-input" type="number" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">INS索引</label>
                    <div class="layui-input-block">
<!--                        <input id="insIndex" name="insIndex" th:value="${node.insIndex}" class="layui-input" type="number" />-->
                        <select name="insIndex" id="insIndex" lay-filter="deviceType">
                            <option value="">请选择INS索引</option>
                            <option value="0" th:selected="${node.insIndex == 0}">对应电流(湿度ins0)</option>
                            <option value="1" th:selected="${node.insIndex == 1}">对应电压(温度ins1)</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" >
                    <label class="layui-form-label">系数A</label>
                    <div class="layui-input-block">
                        <input id="xishuA" name="xishuA" th:value="${node.xishuA}" class="layui-input" type="number" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">系数B</label>
                    <div class="layui-input-block">
                        <input id="xishuB" name="xishuB" th:value="${node.xishuB}" class="layui-input" type="number" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">图表显示最小数</label>
                    <div class="layui-input-block">
                        <input id="minShowValue" name="minShowValue" th:value="${node.minShowValue}" class="layui-input" type="number" />
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">自定义增减值</label>
                    <div class="layui-input-block">
                        <input id="addValue" name="addValue" th:value="${node.addValue}" class="layui-input" type="number" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <div style="text-align: center;margin-top: 20px">
                        <button onclick="update()" class="layui-btn layui-btn-normal">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/device/node/detail.js}"></script>
</body>
</html>
